import request from '@/utils/request'

// 查询用户组列表
export function pageList(data) {
  return request({
    url: '/os/account/list',
    method: 'post',
    data: data
  })
}

// 查询详细
export function getInfo(clientId) {
  return request({
    url: '/os/account/' + clientId,
    method: 'get'
  })
}

// 新增
export function add(data) {
  return request({
    url: '/os/account/add',
    method: 'post',
    data: data
  })
}

// 修改
export function update(data) {
  return request({
    url: '/os/account/edit',
    method: 'post',
    data: data
  })
}

// 状态修改
export function changeStatus(id, status) {
  return request({
    url: '/os/account/changeStatus',
    method: 'get',
     params: { id, status }
  })
}

// 删除
export function del(id) {
  return request({
    url: '/os/account/remove/' + id,
    method: 'delete'
  })
}

// 账户 --已绑定用户组数据
export function getUsersByUserGroupId(query) {
  return request({
    url: '/os/account/getUsersByUserGroupId',
    method: 'get',
    params: query
  })
}

// 账户 --未绑定用户组数据
export function getUnUsersByUserGroupId(query) {
  return request({
    url: '/os/account/getUnUsersByUserGroupId',
   method: 'get',
    params: query
  })
}

// 绑定用户组数据
export function bindUserGroups(query) {
  return request({
    url: '/os/account/bindUserGroups',
   method: 'get',
    params: query
  })
}

export function getClientsByUserGroupId(query) {
  return request({
    url: '/os/account/getClientsByUserGroupId',
  method: 'get',
    params: query
  })
}

export function getUnClientsByUserGroupId(query) {
  return request({
    url: '/os/account/getUnClientsByUserGroupId',
   method: 'get',
    params: query
  })
}

export function getUsersByUserAccountId(query) {
  return request({
    url: '/os/account/getUsersByUserAccountId',
    method: 'get',
    params: query
  })
}

